package org.accp.lipei.service.impl;

import entity.*;
import org.accp.lipei.dto.PageBean;
import org.accp.lipei.mapper.settlement_infomapper;
import org.accp.lipei.service.settlement_infoservice;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class Settlement_infoserviceimpl implements settlement_infoservice {
    @Resource
    private settlement_infomapper settlement_infomapper;
    @Override
    public PageBean lipeiselect(PageBean pb) {
        System.out.println(pb.getSettlement_info());
        int page=pb.getPageIndex();
        int pagesize=pb.getPageSize();
        pb.setPageIndex((page-1)*pagesize+1);
        pb.setPageSize(page*pagesize);
        List<settlement_info> list=settlement_infomapper.lipeiselect(pb);
        System.out.println(list);
        List<settlement_info> count=settlement_infomapper.nolipeiselect(pb);
        PageBean pageb=new PageBean(page,pagesize,count.size());
        pageb.setData(list);
        return pageb;
    }

    @Override
    public void lipeiinsert(settlement_info settlement_info) {
        settlement_infomapper.lipeiinsert(settlement_info);
    }

    @Override
    public recognizee_info bao1(String baoan) {
        String a1=settlement_infomapper.bao1(baoan);
        String a2=settlement_infomapper.bao2(a1);
        recognizee_info a3=settlement_infomapper.bao3(a2);
        return a3;
    }

    @Override
    public List<car_damage_info> chesun(String baoanid) {
        return settlement_infomapper.chesun(baoanid);
    }

    @Override
    public List<object_damage_info> wusun(String baoanid) {
        return settlement_infomapper.wusun(baoanid);
    }

    @Override
    public List<human_injury_info> renshang(String baoanid) {
        return settlement_infomapper.renshang(baoanid);
    }

    @Override
    public void updatelipei(String lipeiid) {
        settlement_infomapper.updatelipei(lipeiid);
    }

    @Override
    public void updatebaoan(String baoanid) {
        settlement_infomapper.updatebaoan(baoanid);
    }


}
